﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Imports Utilerias
Imports Npgsql
Imports MySql.Data.MySqlClient
Public Class MonedaFact
    Public Shared Function Build(ByVal dr As MySqlDataReader) As MonedaBE
        Dim tmpMoneda As MonedaBE = New MonedaBE()
        Try
            With tmpMoneda
                .IdMoneda = convertDTFromDb.convertInt32(dr.Item("IdMoneda"))
                .DesMoneda = convertDTFromDb.ConvertString(dr.Item("DesMoneda"))
                .TipoCambio = convertDTFromDb.ConvertDecimal(dr.Item("TipoCambio"))
                Select Case convertDTFromDb.ConvertString(dr.Item("Status"))
                    Case "A"
                        .Status = MonedaBE.EstatusMoneda.Activa
                    Case "I"
                        .Status = MonedaBE.EstatusMoneda.Inactiva
                    Case Else
                        .Status = MonedaBE.EstatusMoneda.Inactiva
                End Select
                .ValorXML = convertDTFromDb.ConvertString(dr.Item("EnXML"))
                .DescrCentavos = convertDTFromDb.ConvertString(dr.Item("DescrCentavos"))
            End With
            Return tmpMoneda
        Catch ex As Exception
            Throw
        Finally
            tmpMoneda = Nothing
        End Try
    End Function
End Class
